﻿using System;
namespace Producers.Rr.Xtee.Riik.Ee.Producer.Rr {
    
    
    [global::Xtee.Core.Attributes.XmlTypeAttribute(Name="RR63Response", Namespace="http://producers.rr.xtee.riik.ee/producer/rr", Target=typeof(RR63Response))]
    public class RR63ResponseSerializer : global::Xtee.Core.Types.AbstractXteeSerializable {
        
        protected IRR63Response clazz;
        
        public RR63ResponseSerializer(IRR63Response clazz) {
            this.clazz = clazz;
        }
        
        public override void WriteXml(global::Xtee.Core.IXteeXmlWriter Writer) {
            base.WriteXml(Writer);
            Writer.WriteStartElement("veakood");
            Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "integer");
            Writer.WriteString(new global::Xtee.Core.Schema.XsdInteger(((decimal)(clazz.Veakood))).ToString());
            Writer.WriteEndElement();
            Writer.WriteStartElement("veatekst");
            if (clazz.Veatekst!=null) {
                Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.Veatekst))).ToString());
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : Veatekst");
            }
            Writer.WriteEndElement();
            Writer.WriteStartElement("Isikuandmed");
            if (clazz.Isikuandmed!=null) {
                Writer.WriteTypeAttribute("http://schemas.xmlsoap.org/soap/encoding/", "Array");
                Writer.WriteArrayTypeAttribute(">>>RR63Response>Isikuandmed>Isikuandmed", "http://producers.rr.xtee.riik.ee/producer/rr", clazz.Isikuandmed.Count);
                for (int x = 0; ((clazz.Isikuandmed != null) 
                            && (x < clazz.Isikuandmed.Count)); x = (x + 1)) {
                    if (clazz.Isikuandmed[x]!=null) {
                        Writer.WriteStartElement("Isikuandmed");
                        global::Xtee.Core.SerializationMetadata metaIsikuandmed = this.GetMetaData(clazz.Isikuandmed[x]);
                        Writer.WriteTypeAttribute(metaIsikuandmed.TypeQualifiedName.Namespace, metaIsikuandmed.TypeQualifiedName.Name);
                        metaIsikuandmed.NewSerializer(clazz.Isikuandmed[x]).WriteXml(Writer);
                        Writer.WriteEndElement();
                    }
                }
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : Isikuandmed");
            }
            Writer.WriteEndElement();
            Writer.WriteStartElement("Dokumendiandmed");
            if (clazz.Dokumendiandmed!=null) {
                Writer.WriteTypeAttribute("http://schemas.xmlsoap.org/soap/encoding/", "Array");
                Writer.WriteArrayTypeAttribute(">>>RR63Response>Dokumendiandmed>Dokumendiandmed", "http://producers.rr.xtee.riik.ee/producer/rr", clazz.Dokumendiandmed.Count);
                for (int x = 0; ((clazz.Dokumendiandmed != null) 
                            && (x < clazz.Dokumendiandmed.Count)); x = (x + 1)) {
                    if (clazz.Dokumendiandmed[x]!=null) {
                        Writer.WriteStartElement("Dokumendiandmed");
                        global::Xtee.Core.SerializationMetadata metaDokumendiandmed = this.GetMetaData(clazz.Dokumendiandmed[x]);
                        Writer.WriteTypeAttribute(metaDokumendiandmed.TypeQualifiedName.Namespace, metaDokumendiandmed.TypeQualifiedName.Name);
                        metaDokumendiandmed.NewSerializer(clazz.Dokumendiandmed[x]).WriteXml(Writer);
                        Writer.WriteEndElement();
                    }
                }
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : Dokumendiandmed");
            }
            Writer.WriteEndElement();
            Writer.WriteStartElement("Elukohaandmed");
            if (clazz.Elukohaandmed!=null) {
                Writer.WriteTypeAttribute("http://schemas.xmlsoap.org/soap/encoding/", "Array");
                Writer.WriteArrayTypeAttribute(">>>RR63Response>Elukohaandmed>Elukohaandmed", "http://producers.rr.xtee.riik.ee/producer/rr", clazz.Elukohaandmed.Count);
                for (int x = 0; ((clazz.Elukohaandmed != null) 
                            && (x < clazz.Elukohaandmed.Count)); x = (x + 1)) {
                    if (clazz.Elukohaandmed[x]!=null) {
                        Writer.WriteStartElement("Elukohaandmed");
                        global::Xtee.Core.SerializationMetadata metaElukohaandmed = this.GetMetaData(clazz.Elukohaandmed[x]);
                        Writer.WriteTypeAttribute(metaElukohaandmed.TypeQualifiedName.Namespace, metaElukohaandmed.TypeQualifiedName.Name);
                        metaElukohaandmed.NewSerializer(clazz.Elukohaandmed[x]).WriteXml(Writer);
                        Writer.WriteEndElement();
                    }
                }
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : Elukohaandmed");
            }
            Writer.WriteEndElement();
        }
        
        public override void ReadXml(global::Xtee.Core.IXteeXmlReader Reader) {
            base.ReadXml(Reader);
            if (Reader.LocalName=="veakood") {
                if (Reader.IsElementNil()) {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>RR63Response>veakood");
                }
                clazz.Veakood = new global::Xtee.Core.Schema.XsdInteger(Reader.ReadElementString("veakood")).Value;
            }
            else {
                throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>RR63Response>veakood", Reader.LocalName);
            }
            if (Reader.LocalName=="veatekst") {
                if (Reader.IsElementNil()) {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>RR63Response>veatekst");
                }
                clazz.Veatekst = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("veatekst")).Value;
            }
            else {
                throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>RR63Response>veatekst", Reader.LocalName);
            }
            if (Reader.LocalName=="Isikuandmed") {
                if (Reader.IsElementNil()) {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>RR63Response>Isikuandmed");
                }
                clazz.Isikuandmed = new System.Collections.Generic.List<RR63Response.IIsikuandmedType>();
                if ((Reader.IsEmptyElement == false)) {
                    Reader.ReadStartElement("Isikuandmed");
                    for (; ((Reader.NodeType != System.Xml.XmlNodeType.EndElement) 
                                && (Reader.LocalName == "Isikuandmed")); ) {
                        if (Reader.IsElementNil()) {
                            throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>RR63Response>Isikuandmed>Isikuandmed");
                        }
                        global::Xtee.Core.SerializationMetadata metaIsikuandmed = this.GetMetaData<RR63Response.IIsikuandmedType>(Reader, ">>>RR63Response>Isikuandmed>Isikuandmed", "http://producers.rr.xtee.riik.ee/producer/rr");
                        RR63Response.IIsikuandmedType item = metaIsikuandmed.NewEntity<RR63Response.IIsikuandmedType>();
                        clazz.Isikuandmed.Add(item);
                        if ((Reader.IsEmptyElement == false)) {
                            Reader.ReadStartElement("Isikuandmed");
                            metaIsikuandmed.NewSerializer(item).ReadXml(Reader);
                            Reader.ReadEndElement();
                        }
                        else {
                            Reader.Skip();
                        }
                    }
                    Reader.ReadEndElement();
                }
                else {
                    Reader.Skip();
                }
            }
            else {
                throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>RR63Response>Isikuandmed", Reader.LocalName);
            }
            if (Reader.LocalName=="Dokumendiandmed") {
                if (Reader.IsElementNil()) {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>RR63Response>Dokumendiandmed");
                }
                clazz.Dokumendiandmed = new System.Collections.Generic.List<RR63Response.IDokumendiandmedType>();
                if ((Reader.IsEmptyElement == false)) {
                    Reader.ReadStartElement("Dokumendiandmed");
                    for (; ((Reader.NodeType != System.Xml.XmlNodeType.EndElement) 
                                && (Reader.LocalName == "Dokumendiandmed")); ) {
                        if (Reader.IsElementNil()) {
                            throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>RR63Response>Dokumendiandmed>Dokumendiandmed");
                        }
                        global::Xtee.Core.SerializationMetadata metaDokumendiandmed = this.GetMetaData<RR63Response.IDokumendiandmedType>(Reader, ">>>RR63Response>Dokumendiandmed>Dokumendiandmed", "http://producers.rr.xtee.riik.ee/producer/rr");
                        RR63Response.IDokumendiandmedType item = metaDokumendiandmed.NewEntity<RR63Response.IDokumendiandmedType>();
                        clazz.Dokumendiandmed.Add(item);
                        if ((Reader.IsEmptyElement == false)) {
                            Reader.ReadStartElement("Dokumendiandmed");
                            metaDokumendiandmed.NewSerializer(item).ReadXml(Reader);
                            Reader.ReadEndElement();
                        }
                        else {
                            Reader.Skip();
                        }
                    }
                    Reader.ReadEndElement();
                }
                else {
                    Reader.Skip();
                }
            }
            else {
                throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>RR63Response>Dokumendiandmed", Reader.LocalName);
            }
            if (Reader.LocalName=="Elukohaandmed") {
                if (Reader.IsElementNil()) {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>RR63Response>Elukohaandmed");
                }
                clazz.Elukohaandmed = new System.Collections.Generic.List<RR63Response.IElukohaandmedType>();
                if ((Reader.IsEmptyElement == false)) {
                    Reader.ReadStartElement("Elukohaandmed");
                    for (; ((Reader.NodeType != System.Xml.XmlNodeType.EndElement) 
                                && (Reader.LocalName == "Elukohaandmed")); ) {
                        if (Reader.IsElementNil()) {
                            throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>RR63Response>Elukohaandmed>Elukohaandmed");
                        }
                        global::Xtee.Core.SerializationMetadata metaElukohaandmed = this.GetMetaData<RR63Response.IElukohaandmedType>(Reader, ">>>RR63Response>Elukohaandmed>Elukohaandmed", "http://producers.rr.xtee.riik.ee/producer/rr");
                        RR63Response.IElukohaandmedType item = metaElukohaandmed.NewEntity<RR63Response.IElukohaandmedType>();
                        clazz.Elukohaandmed.Add(item);
                        if ((Reader.IsEmptyElement == false)) {
                            Reader.ReadStartElement("Elukohaandmed");
                            metaElukohaandmed.NewSerializer(item).ReadXml(Reader);
                            Reader.ReadEndElement();
                        }
                        else {
                            Reader.Skip();
                        }
                    }
                    Reader.ReadEndElement();
                }
                else {
                    Reader.Skip();
                }
            }
            else {
                throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>RR63Response>Elukohaandmed", Reader.LocalName);
            }
        }
        
        [global::Xtee.Core.Attributes.XmlTypeAttribute(Name=">>>RR63Response>Isikuandmed>Isikuandmed", Namespace="http://producers.rr.xtee.riik.ee/producer/rr", Target=typeof(RR63Response.IsikuandmedType))]
        public class IsikuandmedTypeSerializer : global::Xtee.Core.Types.AbstractXteeSerializable {
            
            protected RR63Response.IIsikuandmedType clazz;
            
            public IsikuandmedTypeSerializer(RR63Response.IIsikuandmedType clazz) {
                this.clazz = clazz;
            }
            
            public override void WriteXml(global::Xtee.Core.IXteeXmlWriter Writer) {
                base.WriteXml(Writer);
                Writer.WriteStartElement("Isikuandmed.Perenimi");
                if (clazz.IsikuandmedPerenimi!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.IsikuandmedPerenimi))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : IsikuandmedPerenimi");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Isikuandmed.Eesnimi");
                if (clazz.IsikuandmedEesnimi!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.IsikuandmedEesnimi))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : IsikuandmedEesnimi");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Isikuandmed.IsikuStaatus");
                if (clazz.IsikuandmedIsikuStaatus!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.IsikuandmedIsikuStaatus))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : IsikuandmedIsikuStaatus");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Isikuandmed.Surmaaeg");
                if (clazz.IsikuandmedSurmaaeg!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.IsikuandmedSurmaaeg))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : IsikuandmedSurmaaeg");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Isikuandmed.Isikukood");
                if (clazz.IsikuandmedIsikukood!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.IsikuandmedIsikukood))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : IsikuandmedIsikukood");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Isikuandmed.Sünniaeg");
                if (clazz.IsikuandmedSünniaeg!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.IsikuandmedSünniaeg))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : IsikuandmedSünniaeg");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Isikuandmed.Kodakondsuskoodina");
                if (clazz.IsikuandmedKodakondsuskoodina!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.IsikuandmedKodakondsuskoodina))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : IsikuandmedKodakondsuskoodina");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Isikuandmed.Kodakondsustekstina");
                if (clazz.IsikuandmedKodakondsustekstina!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.IsikuandmedKodakondsustekstina))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : IsikuandmedKodakondsustekstina");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Isikuandmed.MuudPerenimed");
                if (clazz.IsikuandmedMuudPerenimed!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.IsikuandmedMuudPerenimed))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : IsikuandmedMuudPerenimed");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Isikuandmed.MuudEesnimed");
                if (clazz.IsikuandmedMuudEesnimed!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.IsikuandmedMuudEesnimed))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : IsikuandmedMuudEesnimed");
                }
                Writer.WriteEndElement();
            }
            
            public override void ReadXml(global::Xtee.Core.IXteeXmlReader Reader) {
                base.ReadXml(Reader);
                if (Reader.LocalName=="Isikuandmed.Perenimi") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR63Response>Isikuandmed>Isikuandmed>Isikuandmed.Perenimi");
                    }
                    clazz.IsikuandmedPerenimi = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Isikuandmed.Perenimi")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR63Response>Isikuandmed>Isikuandmed>Isikuandmed.Perenimi", Reader.LocalName);
                }
                if (Reader.LocalName=="Isikuandmed.Eesnimi") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR63Response>Isikuandmed>Isikuandmed>Isikuandmed.Eesnimi");
                    }
                    clazz.IsikuandmedEesnimi = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Isikuandmed.Eesnimi")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR63Response>Isikuandmed>Isikuandmed>Isikuandmed.Eesnimi", Reader.LocalName);
                }
                if (Reader.LocalName=="Isikuandmed.IsikuStaatus") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR63Response>Isikuandmed>Isikuandmed>Isikuandmed.IsikuStaatus");
                    }
                    clazz.IsikuandmedIsikuStaatus = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Isikuandmed.IsikuStaatus")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR63Response>Isikuandmed>Isikuandmed>Isikuandmed.IsikuStaatus", Reader.LocalName);
                }
                if (Reader.LocalName=="Isikuandmed.Surmaaeg") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR63Response>Isikuandmed>Isikuandmed>Isikuandmed.Surmaaeg");
                    }
                    clazz.IsikuandmedSurmaaeg = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Isikuandmed.Surmaaeg")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR63Response>Isikuandmed>Isikuandmed>Isikuandmed.Surmaaeg", Reader.LocalName);
                }
                if (Reader.LocalName=="Isikuandmed.Isikukood") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR63Response>Isikuandmed>Isikuandmed>Isikuandmed.Isikukood");
                    }
                    clazz.IsikuandmedIsikukood = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Isikuandmed.Isikukood")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR63Response>Isikuandmed>Isikuandmed>Isikuandmed.Isikukood", Reader.LocalName);
                }
                if (Reader.LocalName=="Isikuandmed.Sünniaeg") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR63Response>Isikuandmed>Isikuandmed>Isikuandmed.Sünniaeg");
                    }
                    clazz.IsikuandmedSünniaeg = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Isikuandmed.Sünniaeg")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR63Response>Isikuandmed>Isikuandmed>Isikuandmed.Sünniaeg", Reader.LocalName);
                }
                if (Reader.LocalName=="Isikuandmed.Kodakondsuskoodina") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR63Response>Isikuandmed>Isikuandmed>Isikuandmed.Kodakondsuskoodina");
                    }
                    clazz.IsikuandmedKodakondsuskoodina = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Isikuandmed.Kodakondsuskoodina")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR63Response>Isikuandmed>Isikuandmed>Isikuandmed.Kodakondsuskoodina", Reader.LocalName);
                }
                if (Reader.LocalName=="Isikuandmed.Kodakondsustekstina") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR63Response>Isikuandmed>Isikuandmed>Isikuandmed.Kodakondsustekstina");
                    }
                    clazz.IsikuandmedKodakondsustekstina = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Isikuandmed.Kodakondsustekstina")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR63Response>Isikuandmed>Isikuandmed>Isikuandmed.Kodakondsustekstina", Reader.LocalName);
                }
                if (Reader.LocalName=="Isikuandmed.MuudPerenimed") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR63Response>Isikuandmed>Isikuandmed>Isikuandmed.MuudPerenimed");
                    }
                    clazz.IsikuandmedMuudPerenimed = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Isikuandmed.MuudPerenimed")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR63Response>Isikuandmed>Isikuandmed>Isikuandmed.MuudPerenimed", Reader.LocalName);
                }
                if (Reader.LocalName=="Isikuandmed.MuudEesnimed") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR63Response>Isikuandmed>Isikuandmed>Isikuandmed.MuudEesnimed");
                    }
                    clazz.IsikuandmedMuudEesnimed = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Isikuandmed.MuudEesnimed")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR63Response>Isikuandmed>Isikuandmed>Isikuandmed.MuudEesnimed", Reader.LocalName);
                }
            }
        }
        
        [global::Xtee.Core.Attributes.XmlTypeAttribute(Name=">>>RR63Response>Dokumendiandmed>Dokumendiandmed", Namespace="http://producers.rr.xtee.riik.ee/producer/rr", Target=typeof(RR63Response.DokumendiandmedType))]
        public class DokumendiandmedTypeSerializer : global::Xtee.Core.Types.AbstractXteeSerializable {
            
            protected RR63Response.IDokumendiandmedType clazz;
            
            public DokumendiandmedTypeSerializer(RR63Response.IDokumendiandmedType clazz) {
                this.clazz = clazz;
            }
            
            public override void WriteXml(global::Xtee.Core.IXteeXmlWriter Writer) {
                base.WriteXml(Writer);
                Writer.WriteStartElement("Dokumendiandmed.Kood");
                if (clazz.DokumendiandmedKood!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.DokumendiandmedKood))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : DokumendiandmedKood");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Dokumendiandmed.Nimetus");
                if (clazz.DokumendiandmedNimetus!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.DokumendiandmedNimetus))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : DokumendiandmedNimetus");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Dokumendiandmed.Seeria");
                if (clazz.DokumendiandmedSeeria!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.DokumendiandmedSeeria))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : DokumendiandmedSeeria");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Dokumendiandmed.Number");
                if (clazz.DokumendiandmedNumber!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.DokumendiandmedNumber))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : DokumendiandmedNumber");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Dokumendiandmed.Kuupaev");
                if (clazz.DokumendiandmedKuupaev!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.DokumendiandmedKuupaev))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : DokumendiandmedKuupaev");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Dokumendiandmed.Asutus");
                if (clazz.DokumendiandmedAsutus!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.DokumendiandmedAsutus))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : DokumendiandmedAsutus");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Dokumendiandmed.KehtivAlates");
                if (clazz.DokumendiandmedKehtivAlates!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.DokumendiandmedKehtivAlates))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : DokumendiandmedKehtivAlates");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Dokumendiandmed.KehtivKuni");
                if (clazz.DokumendiandmedKehtivKuni!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.DokumendiandmedKehtivKuni))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : DokumendiandmedKehtivKuni");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Dokumendiandmed.IsikuIsikukood");
                if (clazz.DokumendiandmedIsikuIsikukood!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.DokumendiandmedIsikuIsikukood))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : DokumendiandmedIsikuIsikukood");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Dokumendiandmed.Isikukood");
                if (clazz.DokumendiandmedIsikukood!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.DokumendiandmedIsikukood))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : DokumendiandmedIsikukood");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Dokumendiandmed.Perekonnanimi");
                if (clazz.DokumendiandmedPerekonnanimi!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.DokumendiandmedPerekonnanimi))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : DokumendiandmedPerekonnanimi");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Dokumendiandmed.Eesnimi");
                if (clazz.DokumendiandmedEesnimi!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.DokumendiandmedEesnimi))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : DokumendiandmedEesnimi");
                }
                Writer.WriteEndElement();
            }
            
            public override void ReadXml(global::Xtee.Core.IXteeXmlReader Reader) {
                base.ReadXml(Reader);
                if (Reader.LocalName=="Dokumendiandmed.Kood") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR63Response>Dokumendiandmed>Dokumendiandmed>Dokumendiandmed.Kood");
                    }
                    clazz.DokumendiandmedKood = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Dokumendiandmed.Kood")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR63Response>Dokumendiandmed>Dokumendiandmed>Dokumendiandmed.Kood", Reader.LocalName);
                }
                if (Reader.LocalName=="Dokumendiandmed.Nimetus") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR63Response>Dokumendiandmed>Dokumendiandmed>Dokumendiandmed.Nimetus");
                    }
                    clazz.DokumendiandmedNimetus = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Dokumendiandmed.Nimetus")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR63Response>Dokumendiandmed>Dokumendiandmed>Dokumendiandmed.Nimetus", Reader.LocalName);
                }
                if (Reader.LocalName=="Dokumendiandmed.Seeria") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR63Response>Dokumendiandmed>Dokumendiandmed>Dokumendiandmed.Seeria");
                    }
                    clazz.DokumendiandmedSeeria = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Dokumendiandmed.Seeria")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR63Response>Dokumendiandmed>Dokumendiandmed>Dokumendiandmed.Seeria", Reader.LocalName);
                }
                if (Reader.LocalName=="Dokumendiandmed.Number") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR63Response>Dokumendiandmed>Dokumendiandmed>Dokumendiandmed.Number");
                    }
                    clazz.DokumendiandmedNumber = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Dokumendiandmed.Number")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR63Response>Dokumendiandmed>Dokumendiandmed>Dokumendiandmed.Number", Reader.LocalName);
                }
                if (Reader.LocalName=="Dokumendiandmed.Kuupaev") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR63Response>Dokumendiandmed>Dokumendiandmed>Dokumendiandmed.Kuupaev");
                    }
                    clazz.DokumendiandmedKuupaev = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Dokumendiandmed.Kuupaev")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR63Response>Dokumendiandmed>Dokumendiandmed>Dokumendiandmed.Kuupaev", Reader.LocalName);
                }
                if (Reader.LocalName=="Dokumendiandmed.Asutus") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR63Response>Dokumendiandmed>Dokumendiandmed>Dokumendiandmed.Asutus");
                    }
                    clazz.DokumendiandmedAsutus = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Dokumendiandmed.Asutus")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR63Response>Dokumendiandmed>Dokumendiandmed>Dokumendiandmed.Asutus", Reader.LocalName);
                }
                if (Reader.LocalName=="Dokumendiandmed.KehtivAlates") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR63Response>Dokumendiandmed>Dokumendiandmed>Dokumendiandmed.KehtivAlates");
                    }
                    clazz.DokumendiandmedKehtivAlates = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Dokumendiandmed.KehtivAlates")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR63Response>Dokumendiandmed>Dokumendiandmed>Dokumendiandmed.KehtivAlates", Reader.LocalName);
                }
                if (Reader.LocalName=="Dokumendiandmed.KehtivKuni") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR63Response>Dokumendiandmed>Dokumendiandmed>Dokumendiandmed.KehtivKuni");
                    }
                    clazz.DokumendiandmedKehtivKuni = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Dokumendiandmed.KehtivKuni")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR63Response>Dokumendiandmed>Dokumendiandmed>Dokumendiandmed.KehtivKuni", Reader.LocalName);
                }
                if (Reader.LocalName=="Dokumendiandmed.IsikuIsikukood") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR63Response>Dokumendiandmed>Dokumendiandmed>Dokumendiandmed.IsikuIsikukood");
                    }
                    clazz.DokumendiandmedIsikuIsikukood = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Dokumendiandmed.IsikuIsikukood")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR63Response>Dokumendiandmed>Dokumendiandmed>Dokumendiandmed.IsikuIsikukood", Reader.LocalName);
                }
                if (Reader.LocalName=="Dokumendiandmed.Isikukood") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR63Response>Dokumendiandmed>Dokumendiandmed>Dokumendiandmed.Isikukood");
                    }
                    clazz.DokumendiandmedIsikukood = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Dokumendiandmed.Isikukood")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR63Response>Dokumendiandmed>Dokumendiandmed>Dokumendiandmed.Isikukood", Reader.LocalName);
                }
                if (Reader.LocalName=="Dokumendiandmed.Perekonnanimi") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR63Response>Dokumendiandmed>Dokumendiandmed>Dokumendiandmed.Perekonnanimi");
                    }
                    clazz.DokumendiandmedPerekonnanimi = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Dokumendiandmed.Perekonnanimi")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR63Response>Dokumendiandmed>Dokumendiandmed>Dokumendiandmed.Perekonnanimi", Reader.LocalName);
                }
                if (Reader.LocalName=="Dokumendiandmed.Eesnimi") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR63Response>Dokumendiandmed>Dokumendiandmed>Dokumendiandmed.Eesnimi");
                    }
                    clazz.DokumendiandmedEesnimi = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Dokumendiandmed.Eesnimi")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR63Response>Dokumendiandmed>Dokumendiandmed>Dokumendiandmed.Eesnimi", Reader.LocalName);
                }
            }
        }
        
        [global::Xtee.Core.Attributes.XmlTypeAttribute(Name=">>>RR63Response>Elukohaandmed>Elukohaandmed", Namespace="http://producers.rr.xtee.riik.ee/producer/rr", Target=typeof(RR63Response.ElukohaandmedType))]
        public class ElukohaandmedTypeSerializer : global::Xtee.Core.Types.AbstractXteeSerializable {
            
            protected RR63Response.IElukohaandmedType clazz;
            
            public ElukohaandmedTypeSerializer(RR63Response.IElukohaandmedType clazz) {
                this.clazz = clazz;
            }
            
            public override void WriteXml(global::Xtee.Core.IXteeXmlWriter Writer) {
                base.WriteXml(Writer);
                Writer.WriteStartElement("Elukohaandmed.Riigikood");
                if (clazz.ElukohaandmedRiigikood!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.ElukohaandmedRiigikood))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : ElukohaandmedRiigikood");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Elukohaandmed.Riiginimetus");
                if (clazz.ElukohaandmedRiiginimetus!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.ElukohaandmedRiiginimetus))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : ElukohaandmedRiiginimetus");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Elukohaandmed.MaakonnaKood");
                if (clazz.ElukohaandmedMaakonnaKood!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.ElukohaandmedMaakonnaKood))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : ElukohaandmedMaakonnaKood");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Elukohaandmed.MaakonnaNimetus");
                if (clazz.ElukohaandmedMaakonnaNimetus!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.ElukohaandmedMaakonnaNimetus))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : ElukohaandmedMaakonnaNimetus");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Elukohaandmed.VallaKood");
                if (clazz.ElukohaandmedVallaKood!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.ElukohaandmedVallaKood))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : ElukohaandmedVallaKood");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Elukohaandmed.VallaNimetus");
                if (clazz.ElukohaandmedVallaNimetus!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.ElukohaandmedVallaNimetus))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : ElukohaandmedVallaNimetus");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Elukohaandmed.KylaKood");
                if (clazz.ElukohaandmedKylaKood!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.ElukohaandmedKylaKood))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : ElukohaandmedKylaKood");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Elukohaandmed.KylaNimetus");
                if (clazz.ElukohaandmedKylaNimetus!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.ElukohaandmedKylaNimetus))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : ElukohaandmedKylaNimetus");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Elukohaandmed.Tanav");
                if (clazz.ElukohaandmedTanav!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.ElukohaandmedTanav))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : ElukohaandmedTanav");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Elukohaandmed.Majanr");
                if (clazz.ElukohaandmedMajanr!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.ElukohaandmedMajanr))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : ElukohaandmedMajanr");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Elukohaandmed.Korterinr");
                if (clazz.ElukohaandmedKorterinr!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.ElukohaandmedKorterinr))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : ElukohaandmedKorterinr");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Elukohaandmed.AadressTekstina");
                if (clazz.ElukohaandmedAadressTekstina!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.ElukohaandmedAadressTekstina))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : ElukohaandmedAadressTekstina");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Elukohaandmed.Algusekuupaev");
                if (clazz.ElukohaandmedAlgusekuupaev!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.ElukohaandmedAlgusekuupaev))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : ElukohaandmedAlgusekuupaev");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Elukohaandmed.AadressiLiik");
                if (clazz.ElukohaandmedAadressiLiik!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.ElukohaandmedAadressiLiik))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : ElukohaandmedAadressiLiik");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Elukohaandmed.IsikuIsikukood");
                if (clazz.ElukohaandmedIsikuIsikukood!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.ElukohaandmedIsikuIsikukood))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : ElukohaandmedIsikuIsikukood");
                }
                Writer.WriteEndElement();
            }
            
            public override void ReadXml(global::Xtee.Core.IXteeXmlReader Reader) {
                base.ReadXml(Reader);
                if (Reader.LocalName=="Elukohaandmed.Riigikood") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR63Response>Elukohaandmed>Elukohaandmed>Elukohaandmed.Riigikood");
                    }
                    clazz.ElukohaandmedRiigikood = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Elukohaandmed.Riigikood")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR63Response>Elukohaandmed>Elukohaandmed>Elukohaandmed.Riigikood", Reader.LocalName);
                }
                if (Reader.LocalName=="Elukohaandmed.Riiginimetus") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR63Response>Elukohaandmed>Elukohaandmed>Elukohaandmed.Riiginimetus");
                    }
                    clazz.ElukohaandmedRiiginimetus = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Elukohaandmed.Riiginimetus")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR63Response>Elukohaandmed>Elukohaandmed>Elukohaandmed.Riiginimetus", Reader.LocalName);
                }
                if (Reader.LocalName=="Elukohaandmed.MaakonnaKood") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR63Response>Elukohaandmed>Elukohaandmed>Elukohaandmed.MaakonnaKood");
                    }
                    clazz.ElukohaandmedMaakonnaKood = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Elukohaandmed.MaakonnaKood")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR63Response>Elukohaandmed>Elukohaandmed>Elukohaandmed.MaakonnaKood", Reader.LocalName);
                }
                if (Reader.LocalName=="Elukohaandmed.MaakonnaNimetus") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR63Response>Elukohaandmed>Elukohaandmed>Elukohaandmed.MaakonnaNimetus");
                    }
                    clazz.ElukohaandmedMaakonnaNimetus = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Elukohaandmed.MaakonnaNimetus")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR63Response>Elukohaandmed>Elukohaandmed>Elukohaandmed.MaakonnaNimetus", Reader.LocalName);
                }
                if (Reader.LocalName=="Elukohaandmed.VallaKood") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR63Response>Elukohaandmed>Elukohaandmed>Elukohaandmed.VallaKood");
                    }
                    clazz.ElukohaandmedVallaKood = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Elukohaandmed.VallaKood")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR63Response>Elukohaandmed>Elukohaandmed>Elukohaandmed.VallaKood", Reader.LocalName);
                }
                if (Reader.LocalName=="Elukohaandmed.VallaNimetus") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR63Response>Elukohaandmed>Elukohaandmed>Elukohaandmed.VallaNimetus");
                    }
                    clazz.ElukohaandmedVallaNimetus = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Elukohaandmed.VallaNimetus")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR63Response>Elukohaandmed>Elukohaandmed>Elukohaandmed.VallaNimetus", Reader.LocalName);
                }
                if (Reader.LocalName=="Elukohaandmed.KylaKood") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR63Response>Elukohaandmed>Elukohaandmed>Elukohaandmed.KylaKood");
                    }
                    clazz.ElukohaandmedKylaKood = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Elukohaandmed.KylaKood")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR63Response>Elukohaandmed>Elukohaandmed>Elukohaandmed.KylaKood", Reader.LocalName);
                }
                if (Reader.LocalName=="Elukohaandmed.KylaNimetus") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR63Response>Elukohaandmed>Elukohaandmed>Elukohaandmed.KylaNimetus");
                    }
                    clazz.ElukohaandmedKylaNimetus = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Elukohaandmed.KylaNimetus")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR63Response>Elukohaandmed>Elukohaandmed>Elukohaandmed.KylaNimetus", Reader.LocalName);
                }
                if (Reader.LocalName=="Elukohaandmed.Tanav") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR63Response>Elukohaandmed>Elukohaandmed>Elukohaandmed.Tanav");
                    }
                    clazz.ElukohaandmedTanav = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Elukohaandmed.Tanav")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR63Response>Elukohaandmed>Elukohaandmed>Elukohaandmed.Tanav", Reader.LocalName);
                }
                if (Reader.LocalName=="Elukohaandmed.Majanr") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR63Response>Elukohaandmed>Elukohaandmed>Elukohaandmed.Majanr");
                    }
                    clazz.ElukohaandmedMajanr = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Elukohaandmed.Majanr")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR63Response>Elukohaandmed>Elukohaandmed>Elukohaandmed.Majanr", Reader.LocalName);
                }
                if (Reader.LocalName=="Elukohaandmed.Korterinr") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR63Response>Elukohaandmed>Elukohaandmed>Elukohaandmed.Korterinr");
                    }
                    clazz.ElukohaandmedKorterinr = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Elukohaandmed.Korterinr")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR63Response>Elukohaandmed>Elukohaandmed>Elukohaandmed.Korterinr", Reader.LocalName);
                }
                if (Reader.LocalName=="Elukohaandmed.AadressTekstina") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR63Response>Elukohaandmed>Elukohaandmed>Elukohaandmed.AadressTekstina");
                    }
                    clazz.ElukohaandmedAadressTekstina = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Elukohaandmed.AadressTekstina")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR63Response>Elukohaandmed>Elukohaandmed>Elukohaandmed.AadressTekstina", Reader.LocalName);
                }
                if (Reader.LocalName=="Elukohaandmed.Algusekuupaev") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR63Response>Elukohaandmed>Elukohaandmed>Elukohaandmed.Algusekuupaev");
                    }
                    clazz.ElukohaandmedAlgusekuupaev = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Elukohaandmed.Algusekuupaev")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR63Response>Elukohaandmed>Elukohaandmed>Elukohaandmed.Algusekuupaev", Reader.LocalName);
                }
                if (Reader.LocalName=="Elukohaandmed.AadressiLiik") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR63Response>Elukohaandmed>Elukohaandmed>Elukohaandmed.AadressiLiik");
                    }
                    clazz.ElukohaandmedAadressiLiik = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Elukohaandmed.AadressiLiik")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR63Response>Elukohaandmed>Elukohaandmed>Elukohaandmed.AadressiLiik", Reader.LocalName);
                }
                if (Reader.LocalName=="Elukohaandmed.IsikuIsikukood") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR63Response>Elukohaandmed>Elukohaandmed>Elukohaandmed.IsikuIsikukood");
                    }
                    clazz.ElukohaandmedIsikuIsikukood = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Elukohaandmed.IsikuIsikukood")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR63Response>Elukohaandmed>Elukohaandmed>Elukohaandmed.IsikuIsikukood", Reader.LocalName);
                }
            }
        }
    }
}
